<template>
  <div>生命周期</div>
  <button @click="increment">{{ counter }}</button>
</template>

<script>
import { ref, onMounted, onUpdated, onUnmounted } from "vue";
export default {
  setup() {
    let counter = ref(0);
    onMounted(() => {
      console.log("App Mounted");
    });
    onUpdated(() => {
      console.log("App onUpdated");
    });
    onUnmounted(() => {
      console.log("App onUnmounted");
    });

    const increment = () => {
      counter.value++;
    };

    return {
      counter,
      increment
    };
  },
};
</script>

<style scoped>
</style>